
package com.kanjian.music.util;

import java.io.File;

import android.content.Context;
import android.os.Environment;

/**
 * SD卡操作工具类
 * 
 * @author xuyanjun@kanjian.com
 */
public class SDCardUtil {

    public static File getExternalCacheDir(Context context) {
        return context.getExternalCacheDir();
    }

    public static File getCacheDir(Context context) {
        return context.getCacheDir();
    }

    /**
     * 得到mp3下载文件夹路径
     * 
     * @return example: /mnt/sdcard/.kanjian
     */
    public static String getMusicDownLoadDir() {
        String dirPath = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator
                + ".kanjian";
        File dir = new File(dirPath);
        if (!dir.exists()) {
            dir.mkdirs();
        }
        return Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator
                + ".kanjian";
    }
}
